package org.example.elastic.lite.jobs;

import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import lombok.extern.slf4j.Slf4j;

/**
 * 简单作业
 * @author 魏荣杰
 * @date 2022/11/11 09:52
 * @since
 * @version
 */
@Slf4j
public class ExampleDangDynamicSimpleJob implements SimpleJob {


    @Override
    public void execute(ShardingContext shardingContext) {
        log.info("ExampleDangDynamicSimpleJob start");
        String jobName = shardingContext.getJobName();
        String jobParameter = shardingContext.getJobParameter();
        int shardingItem = shardingContext.getShardingItem();
        String shardingParameter = shardingContext.getShardingParameter();
        int shardingTotalCount = shardingContext.getShardingTotalCount();
        String taskId = shardingContext.getTaskId();
        log.info("jobName: {}, jobParameter: {}, shardingItem: {}, shardingParameter: {}, shardingTotalCount: {}, taskId: {}", jobName, jobParameter, shardingItem, shardingParameter, shardingTotalCount, taskId);
        log.info("ExampleDangDynamicSimpleJob end");
    }
}
